<?php

declare(strict_types=1);
/**
 * Created by Vscode
 * User: ChenP
 * Date: 2021-12-03 17:00
 */
namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use App\Services\ActivityService;

/**
 * @AutoController
 */
class ActivityController extends AbstractController
{
    /**
     * @Inject()
     * @var ActivityService
     */
    protected $activityService;

    public function list()
    {
        // $params = $this->validate();

        $data = $this->activityService->list();

        return $this->send($data);
    }

    public function detail()
    {
        $params = $this->validate();

        $data = $this->activityService->detail($params);

        return $this->send($data);
    }

    public function anroll()
    {
        $params = $this->validate();

        $data = $this->activityService->anroll($params);

        return $this->send($data);
    }

    public function contribute()
    {
        $params = $this->validate();

        $data = $this->activityService->contribute($params);

        return $this->send($data);
    }
}
